package vcp.gui.forms.validators;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PhoneValidator {
	private Pattern pattern;
	private Matcher matcher;
	// validation format xxx-xxxxxxx 
	private static final String PATTERN = "\\d{3}-\\d{7}";
	public  PhoneValidator(String opt){
		pattern = Pattern.compile(PATTERN);
	}	
	public boolean validate(String txt){		 
		  matcher = pattern.matcher(txt);
		  return matcher.matches();
	}	
}
